package com.bawei.module_goods.adapter

import android.widget.ImageView
import com.bawei.module_goods.R
import com.bumptech.glide.Glide
import com.youth.banner.adapter.BannerImageAdapter
import com.youth.banner.holder.BannerImageHolder

class DetailBannerAdapter(banners: List<String>) : BannerImageAdapter<String>(banners) {

    override fun onBindView(
        holder: BannerImageHolder?,
        data: String?,
        position: Int,
        size: Int
    ) {
        holder?.let {
            val imageView = it.imageView as ImageView
            imageView.scaleType = ImageView.ScaleType.CENTER_CROP // 可根据需求调整
            Glide.with(it.itemView)
                .load(data)
                .placeholder(R.drawable.bg_ad_placeholder)
                .into(imageView)
        }
    }
} 